package com.java.demo.data;

import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @auther zhangwj
 * @date 2020/7/24 3:28 下午
 */
public class Demo3 {

    public static void main(String[] args) {
        int i = 9;
        switch (i) {
            default:
                System.out.println("default");
            case 0:
                System.out.println("zero");
                break;
            case 1:
                System.out.println("one");
            case 2:
                System.out.println("two");
        }
    }


    public int getData(TreeNode treeNode, Integer data) {
        if (null == treeNode) {
            return data;
        }
        if (null != treeNode.getRight()) {
            data = treeNode.getVal();
            //  getData(treeNode.getTreeNode(), data);
        }
        return data;
    }
}

class A {
    public final void A1() {
        Lock lock = new ReentrantLock();
    }
}

class B extends A {

}


class TreeNode {

    private TreeNode right;

    private TreeNode left;

    private Integer val;


    public TreeNode create(List<Integer> value) {
        if (null == value || value.isEmpty()) {
            return null;
        }
        TreeNode treeNode = new TreeNode();
        value.forEach(integer -> {
            treeNode.setVal(integer);

        });
        return treeNode;
    }

    public TreeNode getRight() {
        return right;
    }

    public void setRight(TreeNode right) {
        this.right = right;
    }

    public TreeNode getLeft() {
        return left;
    }

    public void setLeft(TreeNode left) {
        this.left = left;
    }

    public Integer getVal() {
        return val;
    }

    public void setVal(Integer val) {
        this.val = val;
    }
}
